<!--
 * @Description: Comment
 * @Author: rendc
 * @Date: 2021-09-06 12:11:27
 * @LastEditors: rendc
 * @LastEditTime: 2021-09-06 12:18:24
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Comment</title>
</head>

<body>
  <div class="app">
    <!--  这是注释 -->
  </div>
</body>
<script>
  var commentNode = document.getElementsByClassName("app")[0].firstChild.nextSibling;
  console.log(commentNode);
  console.log(commentNode.nodeName);
  var cNode = document.createComment("这是一个注释");
</script>

</html>